package com.drelephant.commons.req;

import java.util.UUID;

public class BaseChannelReq<T> {

    /**
     * 请求流水(每次请求不同的流水号, 最好使用uuid)
     **/
    private String reqNo = UUID.randomUUID().toString();

    /**
     * 请求时间戳
     */
    private String reqTime;

    /**
     * 渠道信息
     **/
    private String appKey;

    /**
     * AES 密钥
     */
    private String key;
    /**
     * AES IV
     */
    private String salt;

    /**
     * 签名
     **/
    private String sign;

    /**
     * 请求参数
     **/
    private T reqData;

    public BaseChannelReq(String appKey, T reqData) {
        this.appKey = appKey;
        this.reqData = reqData;
        this.reqTime = String.valueOf(System.currentTimeMillis());
    }

    public BaseChannelReq() {
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public T getReqData() {
        return reqData;
    }

    public void setReqData(T reqData) {
        this.reqData = reqData;
    }

    /**
     * @return the reqNo
     */
    public String getReqNo() {
        return reqNo;
    }

    /**
     * @param reqNo the reqNo to set
     */
    public void setReqNo(String reqNo) {
        this.reqNo = reqNo;
    }

    /**
     * @return the sign
     */
    public String getSign() {
        return sign;
    }

    /**
     * @param sign the sign to set
     */
    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getReqTime() {
        return reqTime;
    }

    public void setReqTime(String reqTime) {
        this.reqTime = reqTime;
    }
}
